#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<string.h>

int main(int argc, char* argv[])
{
    if(argc != 2) exit(1);

    int fd = open(argv[1], O_RDONLY);
    if(fd < 0) exit(1);

    dup2(fd, 0);
    close(fd);
    
    while(1)
    {
        char buffer[64];
        if(!fgets(buffer, sizeof(buffer), stdin)) break;

        printf("%s", buffer);
    }

    return 0;
}
